<?php
/**
 * Created by PhpStorm.
 * User: 毛文科
 * Date: 2019/5/22
 * Time: 11:07
 */
namespace app\admin\model;
use think\Model;

class AdminUser extends Model
{
    protected $name = 'admin_user';
    protected $pk = 'id';
    public function __construct($data = [])
    {
        $this->name = session('modular').'_'.$this->name;
        parent::__construct($data);
    }
//    public function getPidAttr($value){
//        if($value==0){
//            $value = '最上级';
//        }else{
//            $pid = AdminUser::where('id',$value)->findOrEmpty()->toArray();
//            if($pid){
//                if($pid['nickname']){
//                    $value = $pid['nickname'];
//                }else{
//                    $value = $pid['user'];
//                }
//            }
//        }
//        return $value;
//    }
}